﻿using BubbleSorter;
using System;
using System.Collections.Generic;
namespace Wrox.ProCSharp.Delegates
{
    class Program
    {
        static void Main()//yfdhsfshsdfhfxd
        {
            Employee[] employees =
            {
                new Employee("Bugs Bunny", 20000,34),
                new Employee("Elmer Fudd", 10000,23),
                new Employee("Daffy Duck", 25000,45),
                new Employee("Wile Coyote", 1000000.38m,46),
                new Employee("Foghorn Leghorn", 23000,25),
                new Employee("RoadRunner", 50000,78)
            };

            BubbleSorter.Sort<Employee>(employees, Employee.CompareSalary);
            BubbleSorter.export(employees, Employee.Print);
            Console.WriteLine();

            foreach (var employee in employees)
            {
                Console.WriteLine(employee);//cgjfghfjghfh
            }
            Console.WriteLine("------------NAME------------");

            //BubbleSorter.Sort<Employee>(employees, Employee.CompareName);

            //foreach (var employee in employees)
            //{
            //    Console.WriteLine(employee);
            //}
           //ftuyulghjgfoulgygyhjk
            var students = new List<Studernt>
           {
               new Studernt{ Id=1,Name="aa"},
               new Studernt{ Id=2,Name="bb"},
               new Studernt{ Id=3,Name="ss"},
               new Studernt{ Id=4,Name="cc"},
               new Studernt{ Id=5,Name="ff"}
           };
            BubbleSorter.Sort(students, Studernt.CompareName);
            BubbleSorter.export(students, Studernt.Print);
            Console.Read();
        }
    }
}
